-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme JSON resolver: read theme.json files from the styles/ folder only once #62638
Conversation
Cache reading theme.json files from styles/ folder.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in 0d79048. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9558154045
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From WordPress/wordpress-develop#6843 (review)
I briefly played around with caching decoded, processed variation files in a local class property. I took "processed" to mean:
Pretty naive implementation, by using the variation file path as a key, similar to Seems to work with very limited testing, but probably deserves its own PR with test cases. Also, the question of whether to extend caching to other theme data. Caching is hard. 😄 |
Sounds similar to the original PR: #62610 I'm sure we can narrow down a solution. This is a good first step though. |
What?
Cache reading theme.json files from styles/ folder.
Syncs the following Core patch to Gutenberg:
styles/
folder. wordpress-develop#6843Why?
From WordPress/wordpress-develop#6843:
How?
From WordPress/wordpress-develop#6843:
Testing Instructions
From WordPress/wordpress-develop#6843:
Go to "Site Editor > Styles" and apply one of them. Verify the changes are reflected in the frontend.
Do the same from the global styles sidebar in the site editor.
Create a
partial.json
file within thestyles/
folder with the following contents:Go to any editor, add a group block, and verify there is a "Partial" style variation (Block Settings > Styles). Apply the variation and save the changes. Verify the contents are the expected (background color is aliceblue) — also in the frontend.
Screenshots or screencast